package gameEngine.agents.Logger.Massages;

import gameEngine.agents.Logger.Massages.MassageEnum.Massage_Type;
import gameEngine.game.TurnBasedScoredGame;
import org.apache.log4j.Logger;
/**
 * create a massage object 
 * @author alon
 *
 */
public class MassageFactory {

	static Logger log = Logger.getLogger(gameEngine.agents.Logger.Massages.MassageFactory.class);
	/**
	 * get an instance according to enum type  
	 * @param type Massage enum
	 * @param game a referance to the game
	 * @return
	 */
	public static Massage create(Massage_Type type,TurnBasedScoredGame game){
		switch(type){
		case SIMPLE_TEXT:
			log.debug("SimpleTextMassage created");
			return new SimpleTextMassage(game);
		case CSV:
			log.debug("CSVMassage created");
			return new CSVMassage(game);	
		}
		log.debug("no massage match for type "+type+"return SimpleTextMassage");
		return new SimpleTextMassage(game);
	}
	
	
}
